package com.example.designpattern.criteria;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: cph
 * @date: 2022/2/14 17:57
 */
public class CriteriaFemale implements Criteria {
    @Override
    public List<Person> meetCriteria(List<Person> personList) {
        List<Person> femaleList = new ArrayList<>();
        for (Person p : personList) {
            if (p.getGender().equalsIgnoreCase("FEMALE")) {
                femaleList.add(p);
            }
        }
        return femaleList;
    }
}
